package com.shuzi.MediaShare.download;

import java.io.Serializable;

import android.R.string;

public class DownloadInfo implements Serializable
{

	/**    */
	private static final long serialVersionUID = -447183245706083527L;

	/** 下载状态：创建一个下载任务的初始状态 */
	public static final int STATE_WAIT = 0;

	/** 下载状态：正在下载 */
	public static final int STATE_DOWNLOADING = 1;

	/** 下载状态：停止 */
	public static final int STATE_STOP = 2;

	/** 下载状态：完成 */
	public static final int STATE_FINISH = 3;

	/** 下载状态：下载出错 */
	public static final int STATE_ERROR = 4;

	public static final int TASK_EVENT_ADD = 100;

	public static final int TASK_EVENT_DELETE = 101;

	/** 下载过程中错误状态：无错误 */
	public static final int ERROR_NA = 0;

	/** 下载过程中错误状态：无网络 */
	public static final int ERROR_NO_NETWORK = 1;

	/** 下载过程中错误状态：无法连接到服务器 */
	public static final int ERROR_NO_CONNECTION = 2;

	/** 下载过程中错误状态：存储器已满 */
	public static final int ERROR_STORAGE_FULL = 3;

	/** 下载过程中错误状态：磁盘写入错误 */
	public static final int ERROR_WRITE_FAILD = 4;

	/** 下载过程中错误状态：服务器端错误 */
	public static final int ERROR_HTTP_FAILD = 5;

	/** 下载过程中错误状态：服务器端错误 */
	public static final int ERROR_RUNTIME_EXCEPTION = 6;

	/** 下载进度 */
	private int downloadPercent = 0;

	/** 下载状态 */
	private int state = STATE_WAIT;

	/** 任務名稱 */
	private String name = "";

	/** 下载地址 */
	private String downloadUrl = "";

	/** 下载文件保存路径 */
	private String downloadPath = "";

	/** 下载速度 */
	private String downloadSpeed = "";

	/** 已经下载了多少 */
	private String hadDownloadSize = "0M";

	/** 下載總大小 */
	private String totleSize = "0M";

	private String key = "";

	/** 下载文件格式 */
	public static final String MP4 = "mp4";

	/** 下载类型 */
	private String downloadType = MP4;

	public DownloadInfo(String name, String downloadUrl, String key)
	{
		this.name = name;
		this.downloadUrl = downloadUrl;
		this.key = key;
	}

	public String getDownloadType()
	{
		return downloadType;
	}

	public void setDownloadType(String downloadType)
	{
		this.downloadType = downloadType;
	}

	public String getTotleSize()
	{
		return totleSize;
	}

	public void setTotleSize(String totleSize)
	{
		this.totleSize = totleSize;
	}

	public String getHadDownloadSize()
	{
		return hadDownloadSize;
	}

	public void setHadDownloadSize(String hadDownloadSize)
	{
		this.hadDownloadSize = hadDownloadSize;
	}

	public String getKey()
	{
		return key;
	}

	public void setKey(String key)
	{
		this.key = key;
	}

	public String getDownloadSpeed()
	{
		return downloadSpeed;
	}

	public void setDownloadSpeed(String downloadSpeed)
	{
		this.downloadSpeed = downloadSpeed;
	}

	public String getDownloadPath()
	{
		return downloadPath;
	}

	public void setDownloadPath(String downloadPath)
	{
		this.downloadPath = downloadPath;
	}

	public String getDownloadUrl()
	{
		return downloadUrl;
	}

	public void setDownloadUrl(String downloadUrl)
	{
		this.downloadUrl = downloadUrl;
	}

	public int getDownloadPercent()
	{
		return downloadPercent;
	}

	public void setDownloadPercent(int downloadPercent)
	{
		this.downloadPercent = downloadPercent;
	}

	public int getState()
	{
		return state;
	}

	public void setState(int state)
	{
		this.state = state;
	}

	public String getName()
	{
		return name;
	}

	public void setName(String name)
	{
		this.name = name;
	}

	public void reset()
	{
		downloadPercent = 0;
		totleSize = "0M";
		downloadSpeed = "";
		hadDownloadSize = "0M";
		state = STATE_WAIT;
	}

}
